home *** CD-ROM | disk | FTP | other *** search
- /*****************************************************************************
-
- This file is part of x2600, the Atari 2600 Emulator
- ===================================================
-
- Copyright 1996 Alex Hornby. For contributions see the file CREDITS.
-
- This software is distributed under the terms of the GNU General Public
- License. This is free software with ABSOLUTELY NO WARRANTY.
-
- See the file COPYING for details.
-
- $Id: vmachine.h,v 2.13 1996/11/24 16:55:40 ahornby Exp $
-
- Tweaked by Matthew Stroup for Amiga v2600, January 27, 1997.
-
- ******************************************************************************/
-
-
- /*
- External definitions of the 2600 virtual machine.
- */
-
-
- #ifndef VMACHINE_H
- #define VMACHINE_H
-
- extern int rom_size;
- extern UBYTE theCart[16384];
- extern UBYTE *theRom;
- extern UBYTE cartScratch[4096];
- extern UBYTE cartRam[1024];
- extern UBYTE theRam[128];
- extern UBYTE riotRead[0x298];
- extern UBYTE riotWrite[0x298];
- extern UBYTE tiaWrite[0x2d];
- extern UBYTE tiaRead[0x0e];
- extern UBYTE keypad[2][4];
-
- extern int reset_flag;
-
- extern int ebeamx, ebeamy, sbeamx;
-
- #define VSYNCSTATE 1
- #define VBLANKSTATE 2
- #define HSYNCSTATE 4
- #define DRAWSTATE 8
- #define OVERSTATE 16
-
- extern int vbeam_state, hbeam_state;
-
- extern int tv_width, tv_height, tv_vsync, tv_vblank,
- tv_overscan, tv_frame, tv_hertz, tv_hsync;
-
- extern int timer_res, timer_count, timer_clks;
-
- extern struct PlayField {
- UBYTE pf0,pf1,pf2;
- UBYTE ref;
- } pf[2];
-
- extern struct Paddle {
- int pos;
- int val;
- } paddle[4];
-
- extern struct Player {
- int x;
- UBYTE grp;
- UBYTE hmm;
- UBYTE vdel;
- UBYTE vdel_flag;
- UBYTE nusize;
- UBYTE reflect;
- UBYTE mask;
- } pl[2];
-
- struct RasterChange {
- int x; /* Position at which change happened */
- int type; /* Type of change */
- int val; /* Value of change */
- } ;
-
- extern struct RasterChange pl_change[2][80], pf_change[1][80], unified[80];
-
- extern int pl_change_count[2], pf_change_count[1], unified_count;
-
- /* The missile and ball positions */
- extern struct Missile {
- int x;
- UBYTE hmm;
- UBYTE locked;
- UBYTE enabled;
- UBYTE width;
- UBYTE vdel;
- UBYTE vdel_flag;
- UBYTE mask;
- } ml[3];
-
- /****************************************************************************
- functions.
- *****************************************************************************/
-
- void do_plraster_change(int i, int type, int val);
-
- void do_unified_change(int type, int val);
-
- void use_unified_change( struct RasterChange *rc);
-
- void use_plraster_change( struct Player *pl, struct RasterChange *rc);
-
- void do_pfraster_change(int i, int type, int val);
-
- void use_pfraster_change( struct PlayField *pf, struct RasterChange *rc);
-
- void init_hardware(void);
- void init_banking(void);
-
- void set_timer(int res, int count, int clkadj);
- UBYTE do_timer(int clkadj);
- void do_vblank(UBYTE b);
- void do_hsync(void);
-
- int do_paddle(int padnum);
- UBYTE do_keypad(int pad, int col);
- void do_screen(int clks);
-
- #endif
-